package com.seven.domain;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import java.math.BigDecimal;
import lombok.Data;

import java.util.Date;

/**
 * @author seven
 */
@Data
public class Ticket implements Comparable<Ticket>{

  @ExcelIgnore
  private String id;

  private Boolean success;

  @ExcelIgnore
  private Date createdAt;
  @ExcelIgnore
  private Boolean deleted;

  private String code;
  private String number;
  private String date;
  private String checkNum;
  private String userName;
  private String userCode;
  private String groupName;
  private String taxCode;
  private String taxTypeCode;
  private BigDecimal total;

  @ExcelIgnore
  private String fileName;

  @ExcelIgnore
  private String message;

  @ExcelIgnore
  private String token;

  private Integer numberOfPages;

  @Override
  public int compareTo(Ticket o) {
    if (o != null && o.getCreatedAt() != null && this.getCreatedAt() != null) {
      return o.getCreatedAt().compareTo(this.createdAt);
    } else {
      return 1;
    }
  }
}
